<?php
//Logging class
class Logger{
	public function log( $level, $message, $user='', $action='' ){
		//db instantce	
		$_db = new MysqlDB( );		
		
		//Sanification
		$level = $_db->real_escape_string( $level );
		$message = $_db->real_escape_string( $message );
		$user = $_db->real_escape_string( $user );
		$action = $_db->real_escape_string( $action );
			
		$_mysql_query_log_error =
		"
			INSERT INTO sys_logs
				( type, message, user, action )
					VALUES ( {$level}, '{$message}', {$user}, '{$action}' )
		";
		
		$_db->query( $_mysql_query_log_error );		
		
		//No error management, what happens when the doctor is ill??
		
	}
}